package com.ruoyi.langchain4j.controller;

import dev.langchain4j.model.ollama.OllamaChatModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @description:
 * @author: lizhihua
 * @date: 2025/6/7
 */
@Tag(name = "测试")
@RestController
@RequestMapping("/test")
public class test {

    @Autowired
    private OpenAiChatModel openAiChatModel;
    @Autowired
    private OllamaChatModel ollamaChatModel;


    @GetMapping("/test1")
    @Operation(summary = "测试1")
    public String test() {
        String chat = openAiChatModel.chat("我是谁?");
        return chat;
    }

}
